﻿using System.Web.Script.Services;
using System.Web.Services;

namespace SoulSolutions.Cluster.JavaScriptControl.Services
{
    [WebService(Namespace = "http://soulsolutions.com.au/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ScriptService]
    public class MapService : WebService
    {
        [WebMethod(Description = "Gets an optomised string of data for rendering on a VE map based on the lat/lon bounds and Zoomlevel supplied")]
        [ScriptMethod]
        public string GetClusteredMapData(string encodedBounds, int zoomLevel, bool isClustered)
        {
            return ClusterBusinessLogic.GetClusteredMapData(encodedBounds, zoomLevel, isClustered);
        }

        [WebMethod(Description = "Gets the content for a pushpin showing all data based on the lat/lon bounds supplied")]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public MapData GetPushPin(string encodedBounds, int startIndex)
        {
            return ClusterBusinessLogic.GetClusteredPinData(encodedBounds, startIndex, 20);
        }
    }
}